<template>
    <div class="wrap">
        <look-header :left="'<'" :center="'直播吧'" :right="'评论'" :status="true"></look-header>
        <div class="main">
            <h2>
                {{list.title}}
                <img :src="list.img" alt="">
            </h2>
        </div>
    </div>
</template>

<script>
import LookHeader from '@/components/LookHeader'
export default {
    components:{
        LookHeader
    },
    data(){
        return {
            data:[],
            list:{},
        }
    },
    created(){
        let id = this.$route.query.id
        this.$http.get("/list").then(res => {
            if(res.data.code == 0){
                res.data.data.forEach(ele => {
                    ele.children.forEach(item => {
                        this.data.push(item)
                    })
                });
               let ind =  this.data.findIndex(item => {
                    return item.id == id
                })
                this.list = this.data[ind]
            }
            
        })
    }
}
</script>

<style>
    .main h2 img{
        width: 200px;
        height: 200px;
    }
</style>
